﻿Public Class Main

  Private Sub Main_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load

    Call InitApp()    'инициализация параметров

    Me.Text = String.Format("Система Сопровождения Проектной Деятельности ({0})", UserInfo.FIO)


  End Sub


  Private Sub FormListToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles FormListToolStripMenuItem.Click

    Dim FL As Form = New WorkerList
    Call OpenForm(FL, Me, 0) 'открываем 1 экземпляр формы

    FL.Text = "Заголовок окна"
    'MsgBox(FL.Text)
    'FL.Dispose()   'уничтожаем форму

  End Sub


#Region "Меню Окно"


  Private Sub МенюОкноКаскадом_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles МенюОкноКаскадом.Click

    Me.LayoutMdi(MdiLayout.Cascade)

  End Sub


  Private Sub МенюОкноВертикально_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles МенюОкноВертикально.Click

    Me.LayoutMdi(MdiLayout.TileVertical)

  End Sub


  Private Sub МенюОкноГоризонтально_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles МенюОкноГоризонтально.Click

    Me.LayoutMdi(MdiLayout.TileHorizontal)

  End Sub


  Private Sub МенюОкноСвернутьВсе_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles МенюОкноСвернутьВсе.Click

    For Each tmpFrm As Form In Me.MdiChildren
      tmpFrm.WindowState = FormWindowState.Minimized
    Next

  End Sub


  Private Sub МенюОкноРазвернутьВсе_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles МенюОкноРазвернутьВсе.Click

    For Each tmpFrm As Form In Me.MdiChildren
      tmpFrm.WindowState = FormWindowState.Normal
    Next

  End Sub


  Private Sub МенюОкноЗакрытьВсе_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles МенюОкноЗакрытьВсе.Click

    For Each tmpFrm As Form In Me.MdiChildren
      tmpFrm.Close()
      tmpFrm.Dispose()
    Next

  End Sub

#End Region


End Class
